<#include "/common/head.ftl">

<@showTitle title="${i18n.getMessage('registerForWaitingOffering')}"></@showTitle>

<div id="error" style="display:none"></div>

<form action="program/addWaiting.sgt" validator="program/validateWaiting.sgt" onsubmit="submitFormValidation(this); return false;" onreset="$('error').hide()">
	<input type="hidden" name="studentId" value="${(student.id)!}"/>
	<table id="dataTable" cellspacing="5" cellpadding="0" align="center">
		<tr>
			<td class="name">${i18n.getMessage('student')}</td>
			<td><a href="#" onclick="cc('student/showInfoStudent.sgt?id=${student.id}')">${(student.fullName)!}</a></td>
		</tr>
		<tr>
			<td class="name"><@required/>${i18n.getMessage('level')}:</td>
			<td>
				<select name="levelId" style="width:205px">
					<option></option>
					<#list programs as program>
						${request.setAttribute("levels", program.levels)}
						<optgroup label="${program.name}">
							<#list levels as level>
								<option value="${level.id}">${level.name}</option>
							</#list>
						</optgroup>
					</#list>
				</select>
			</td>
		</tr>
		<tr>
			<td class="name"><@required/>${i18n.getMessage('registeredDate')}:</td>
			<td><input type="text" name="registeredDate" value=${now?date} style="width:200px"/><img class="calendarImg" src="images/calendar/calendar.gif" onclick="displayCalendar(document.forms[0].registeredDate, '${i18n.getMessage('format.date')}', this)"/></td>
		</tr>
		<tr>
			<td class="name" style="vertical-align:top">${i18n.getMessage('comment')}:</td>
			<td><textarea name="comment" style="width:350px;height:80px;"></textarea></td>
		</tr>
		<tr>
			<td></td>
			<td>
				<input type="submit" value="${i18n.getMessage('wait')}" class="button_style"/> 
				<input type="reset" value="${i18n.getMessage('reset')}" class="button_style"/>
			</td>
		</tr>
	</table>
</form>

<script>
	$('error').hide();
</script>